<!DOCTYPE html>
<html>
<head>
    <title>#{title}</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <meta name="description" content="">

    <link rel="stylesheet" href="/lib/weui.min.css">
    <link rel="stylesheet" href="/css/jquery-weui.css">
    <link rel="stylesheet" href="/css/home.css">
    <style>
        .editor-textarea{
            padding:10px;font-size: 1.5em;
        }
        .kk-box{background-color: white;margin-bottom: 0.3rem}
        .kk-block-bd{padding:0.5rem;display: block}
        .ul-extral{list-style: none;}
        .bg{background-color: #DEDEDE;}
        .ul-extral li{height: 35px;line-height: 30px;margin-bottom: 5px;border-bottom: solid 1px #c7c7cc }
        .extralInput{width: 80px;height: 30px;line-height: 30px;background-color: #E1E1E1;border-radius: 5px}


        .save{position: absolute; right: 0.5rem;top: 0.5rem;color: #943411}
        .text{color: #9e9d9b}

        .before_box{background-color:white; height: 35px;padding-top: 10px}
        .before{color:#943411 }
    </style>
</head>

<body ontouchstart>

<div class="weui-flex">
    <div class="weui-flex__item">
        <div class="home-header" >
            <a href="javascript:;"><span class="back-to-pre"></span></a>
            <h2>中医线上咨询收费设置</h2>
            <a href="javascript:;" class="save finish">保存</a>
        </div>
        <div class="editor-textarea">
            <textarea class="weui-textarea" id="chargeDesc" placeholder="请输入内容" rows="4"></textarea>
            <div class="weui-textarea-counter"><span>0</span>/1000</div>
        </div>
        <span class="text">患者将在您的主页上看到以上收费说明</span>
    </div>
</div>

<div class="kk-box ">
    <div class="kk-block-bd" >
        <ul class="ul-extral">
            <li v="0">免费</li>
            <li v="20">￥20</li>
            <li v="50">￥50</li>
            <li v="100">￥100</li>
            <li v="200">￥200</li>
            <li style="border: 0px;margin-top: 10px">自定义￥<input class="extralInput" type="number" id=""/>
                <span class="text">自定义金额范围为1-9999元</span></li>
        </ul>
    </div>
</div>
<div class="before_box">
    <span class="before" id="chargeFee"></span>
</div>
<div style="margin-top: 10px">
    <a class="weui-btn weui-btn_primary finish" href="javascript:" style="line-height:2;width:90%"> 完 成 </a>
</div>
<script src="/lib/jquery-2.1.4.js"></script>
<script src="/js/jquery-weui.js"></script>
<script src="/lib/fastclick.js"></script>
<script src="/js/home.js"></script>
<script src="/js/notice_setting.js"></script>
<script>
    $(function(){

        var doctorId = getQueryString("doctorId");
        var fee = getQueryString("chargeFee")
        console.log(fee);
        $(".ul-extral li").click(function(){
            $(".ul-extral li:not(:last)").css("border-bottom","1px solid #c7c7cc");
            $(".ul-extral li").removeClass("bg")
            if(!$(this).hasClass("bg")){
                if($(this).attr("v")==undefined){
                    fee = $(this).find("input").val();
                }else{
                    $(this).css("border-bottom","0px").addClass("bg");
                    fee = $(this).attr("v");
                }
            }else{
                $(this).removeClass("bg");
            }
        });

        $(".finish").click(function(){

            var data = {"doctorId": doctorId, "chargeFee": fee,"chargeDesc":$("#chargeDesc").val()};
            $.ajax({
                url: "/notice/updateNotice",
                type: "post",
                dataType: "json",
                data: data,
                success: function (result) {
                    console.log(result.msg);
                    window.location.href='../studio/notice_setting.html?doctorId='+doctorId;
                    //alert(result.msg)
                }, error: function () {
                    //alert("ajax出错");
                }
            });
        });
    });

</script>
</body>
</html>
